package com.winai.launcher.bean.db;

import org.litepal.crud.LitePalSupport;

import java.io.Serializable;

/**
 * 作者：康少
 * 时间：2020/4/18 0018
 * 说明：定位信息缓存
 * 注意！！！修改属性之后，需要在litepal.xml里升级版本号
 */
public class CurrentLocation extends LitePalSupport implements Serializable {
    private int id = 1;
    private double longitude = -1;//经度
    private double latitude = -1;//纬度
    private String adminArea = "";//省/市
    private String locality = "";//市
    private String subLocality = "";//区

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public double getLongitude() {
        return longitude;
    }

    public void setLongitude(double longitude) {
        this.longitude = longitude;
    }

    public double getLatitude() {
        return latitude;
    }

    public void setLatitude(double latitude) {
        this.latitude = latitude;
    }

    public String getAdminArea() {
        return adminArea;
    }

    public void setAdminArea(String adminArea) {
        if (adminArea.contains("省") || adminArea.contains("市") || adminArea.contains("区")) {
            adminArea = adminArea.replace("省", "");
            adminArea = adminArea.replace("市", "");
            adminArea = adminArea.replace("区", "");
        }
        this.adminArea = adminArea;
    }

    public String getLocality() {
        return locality;
    }

    public void setLocality(String locality) {
        if (locality.contains("省") || locality.contains("市") || locality.contains("区")) {
            locality = locality.replace("省", "");
            locality = locality.replace("市", "");
            locality = locality.replace("区", "");
        }
        this.locality = locality;
    }

    public String getSubLocality() {
        return subLocality;
    }

    public void setSubLocality(String subLocality) {
        if (subLocality.contains("省") || subLocality.contains("市") || subLocality.contains("区")) {
            subLocality = subLocality.replace("省", "");
            subLocality = subLocality.replace("市", "");
            subLocality = subLocality.replace("区", "");
        }
        this.subLocality = subLocality;
    }
}
